package app.agent.systems

import app.agent.systems.SystemsLocator._
import app.server.SystemsResponse
import im.mange.jetboot.{Renderable, Html}
import Html._
import app.comet.Subscriber

//TODO: potentially this is shareable?
case class SystemsContentAgent(subscriber: Subscriber) extends Renderable {
  private val holder = div(systemsContentAgent).classes("hidden")

  override def render = holder.render

  def onHide = holder.empty & holder.hide
  def onShowResponse(response: SystemsResponse) = holder.show & holder.fill(SystemsContentPresentation(response.systems, subscriber))
}

